from utils import xprimes 

MAX=1000
primes = set([i for i in xprimes(2*MAX*MAX+MAX)])

list = []
for b in xprimes(MAX):
    for a in range(-b, MAX, 2):
        for n in range(0, MAX):
            if ( n * n + a * n + b) not in primes:
                list += [(n, a*b)]
                break

print  max(list)[1]
